﻿using UnityEngine;
using System.Collections;
using System;

namespace HWGAME
{ 
    public class AdCtrl : MonoBehaviour
    {

        public static AdCtrl Instance;

        //激励视频状态（是否加载好）发生变化时
        public event Action OnRewardVideoAdStatusChange;

        void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            LoadInterAd();
            LoadRewardVideoAd();
            LoadNativeAd();
        }

        #region 插屏广告接口
        /// <summary>
        /// 加载插屏广告，在游戏开始时调用
        /// </summary>
        private void LoadInterAd()
        {

        }

        /// <summary>
        /// 显示插屏广告
        /// </summary>
        public void ShowInterAd()
        {

        }
        #endregion

        #region 激励视频广告接口
        /// <summary>
        /// 加载激励视频广告，在游戏开始时调用
        /// </summary>
        private void LoadRewardVideoAd()
        {

        }

        /// <summary>
        /// 显示激励视频广告
        /// </summary>
        /// <param name="playResult">激励视频播放是否成功</param>
        public void ShowRewardVideoAd(Action<bool> playResult)
        {

        }

        /// <summary>
        /// 激励视频广告当前状态
        /// </summary>
        public bool IsRewardVideoAdLoaded
        {
            get { return true; }
        }

        /// <summary>
        /// 激励视频广告状态发生变化时
        /// </summary>
        private void OnRewardAdStatusChange()
        {
            if (OnRewardVideoAdStatusChange != null)
            {
                OnRewardVideoAdStatusChange();
            }
        }
        #endregion

        #region 原生广告接口
        /// <summary>
        /// 请求原生广告（游戏开始时请求）
        /// </summary>
        private void LoadNativeAd()
        {

        }

        /// <summary>
        /// 显示原生广告
        /// </summary>
        public void ShowNativeAd()
        {

        }

        /// <summary>
        /// 隐藏原生广告
        /// </summary>
        public void HideNativeAd()
        {

        }
        #endregion

    }
}
